#pragma once
#include <iostream>
#include <QWidget>
#include <QMessageBox>
#include "ui_LogIn.h"
#include <vector>
#include <QFile>
#include <qpainter.h>
#include <QTextStream>
using namespace std;
extern vector<QString> schoolName;
extern vector<QString> passwords;
extern vector<QString> question;
extern vector<QString> anwser;

class LogIn : public QWidget
{
	Q_OBJECT
		
public:
	LogIn(QWidget *parent = nullptr);
	~LogIn();
	QString readSchool;
	QString readPassword;
	QString readQuestion;
	QString readAnwser;
	void paintEvent(QPaintEvent* event);
	friend void message(QString title, QString text, QMessageBox::Icon icon, QMessageBox::Button buttonType, QWidget* parent);
private:
	Ui::LogInClass ui;
private slots:
	void login();

};
//schoolName和passwords的文件读写
 void saveFile(vector<QString>& schoolName, vector<QString>& passwords, vector<QString>& question, vector<QString>& anwser, const QString& filename);
 void loadFile(vector<QString>& schoolName, vector<QString>& passwords, vector<QString>& question, vector<QString>& anwser, const QString& filename);

 